MediaInitialize
TheMediaInitialize
function allows your derived media handler component to prepare itself for providing access to its media.
pascal ComponentResult MediaInitialize (ComponentInstance ci, GetMovieCompleteParams *gmc);
ci
- Identifies the Movie Toolbox's connection to your derived media handler.
gmc
- Contains a pointer to a complete movie parameter structure, which is described in "Data Type" beginning on page 10-13. You can obtain information about the current media from this structure. You should
copy any values you need to save into your derived media handler's local data area.- Because this data structure is owned by the Movie Toolbox, you do not need to worry about disposing of any of the data in it.
DESCRIPTION
Once the Movie Toolbox has loaded a movie's data from its file, the toolbox calls your derived media handler'sMediaInitialize
function. If the user is creating a new movie, the Movie Toolbox calls your media handler anyway, even though there may be no media data.This function gives your media handler an opportunity to get ready to support
the Movie Toolbox. As part of these preparations, your derived media handler
should report its capabilities to the base media handler by calling theMediaSetHandlerCapabilities
function (see page 10-36 for more information about this function).You may choose to examine the data in the movie parameter structure; you may also save values from this structure. If you save references to structures (such as the matte pixel map), do not dispose of the memory associated with these structures. The Movie Toolbox owns these structures.
All derived media handlers should support this function. In addition, if your media handler saves values from the movie parameter structure that may change, be sure to support the corresponding functions that allow the Movie Toolbox to report changes to your media handler. For example, if your handler saves the movie time scale from the
movieScale
field, you should also support theMediaSetMovieTimeScale
function.If you return an error, the Movie Toolbox disables the track that uses your media. In cases where your media has just been created, the Movie Toolbox immediately disposes of your media.
Note that the Movie Toolbox may call other functions supported by your media handler before it calls your
MediaInitialize
function. In particular, it may call yourMediaGetMediaInfo
andMediaPutMediaInfo
functions. However, before the Movie Toolbox tries to do anything with the data in your media, it will call yourMediaInitialize
function. The Movie Toolbox loads the movie's data using functions that are supported by the base media handler--your media handler does not have to support those functions.RESULT CODES
Any Component Manager result code
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help